package com.wpf.hf.controller;

import com.wpf.hf.entity.Result;
import com.wpf.hf.entity.UserOrderVo;
import com.wpf.hf.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/findUser/{username}")
    public Result findUser(@PathVariable("username") String username){
        UserOrderVo vo = userService.findUserById(username);
        return new Result(true,"查询成功",vo);

    }
}
